<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>系统管理页面</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/themes/default/easyui.css">   
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/themes/icon.css">  

<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.8.2.min.js"></script>   
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.easyui.min.js"></script> 
 <script type="text/javascript" src="<%=request.getContextPath() %>/js/syUtil.js"></script>
 
 
  <!-- 如果不加准备函数 必须放在树的标签下，加准备函数后可以放在头上 -->
  <script type="text/javascript">
			$(function(){
				$("#tree").tree({
					url:"<%=request.getContextPath() %>/power/getPower",
					idFiled:"id",
			  		textFiled:"name",
			  		parentField:"pid",
			  		lines:true,
		    		onClick:function(node){
		    			//判断是否为叶子节点
		    			if($("#tree").tree('isLeaf',node.target)){
		    	   			alert(node.url);
			    			var context='<iframe frameborder="0" scrolling="auto" style="width: 100%;height: 100%" src="'+node.url+'""></iframe>';
			    			
			    			/* 如果选项卡存在则选中，否则添加 */
			    			if($('#tabs').tabs('exists',node.text)){
			    				$('#tabs').tabs('select',node.text)
			    			}else{
			    				//选项卡的添加
				    			$("#tabs").tabs('add',{
				    					 title:node.text,    
									     /* content:context, */
									     href:node.url,
									    closable:true,    
									    tools:[{    
									    iconCls:'icon-mini-refresh', 
									    cache:true,
									    handler:function(){    
									    alert('refresh');    
									        }    
									    }]    
				    				
				    			
				    			
				    			});
			    				
			    			}
							
						}
		 
		    			
		    				
		    		}
				
				});
			})
		</script>

 
</head>
<body>
<body class="easyui-layout">   
    <div data-options="region:'north',title:'Title',split:true" style="height:150px;">
    <center><h1>后台管理系统</h1></center>	
    </div>        
    <div data-options="region:'west',title:'TREE',split:true" style="width:200px;">
    	<!-- easyui的树 -->
    	<ul id="tree"></ul>
    	
    </div>   
    <div data-options="region:'center'" style="padding:5px;background:#eee;">
    		 
   
   		<div id="tabs" class="easyui-tabs" style="width:500px;height:250px;" border="false" fit="true">   
		   	<div align="center" data-options="title:'首页'">
		   		<center>	<h1 style="margin-top: 250px;font-size: 200px;color: green">欢迎</h1></center>
		   			
		   			
		   	</div>
     
		</div>  
  
   
   
 
    
    
    </div>   
</body>  




</body>
</html>